package Controller;

import Service.CustomerService;
import pojo.Customer;

import java.sql.SQLException;
import java.util.List;

public class CustomerController {
    private CustomerService customerService;

    public CustomerController() throws Exception {
        customerService = new CustomerService();
    }
    //查询所有顾客
    public List<Customer> getAllCustomer() throws Exception {
        List<Customer> customerList = customerService.getAllCustomer();
        return customerList;
    }

    //删除顾客
    public void deletecustomer(int del_customerid) throws SQLException {
        customerService.deletecustomer(del_customerid);
    }

    //查询部分顾客
    public List<Customer> getCarByBrand(String searchText) throws SQLException {
        return customerService.getCarByBrand(searchText);
    }

    public Boolean addcustomer(Customer customer) throws SQLException {
        return customerService.addcustomer(customer);
    }
}
